package chapter13;

/**
 * @author : DuJiabao
 * @Date : 2021/2/20 21:56
 * @Project : thinking-in-java
 * @File : null.java
 * @Desc :
 */
public class ConcatTest {
  public static void main(String[] args) {
    String res = "";
    long start = System.currentTimeMillis();
    for (int i = 0; i < 10000; i++) {
      res += i;
    }
    System.out.println(System.currentTimeMillis() - start);

    StringBuilder result = new StringBuilder();
    start = System.currentTimeMillis();
    for (int i = 0; i < 10000; i++) {
      result.append(i);
    }
    System.out.println(System.currentTimeMillis() - start);
  }
}
